const handler = require('./handler')
const schema = require('./schema')
const expressJoi = require('@escook/express-joi')
const router = require('express').Router()

//获取文章分类列表
router.get('/article/cates', handler.getArticleCate)
// 新增文章分类
router.post(
  '/article/addcates',
  expressJoi(schema.name_alias),
  handler.addArticleCate
)
//删除文章分类by id
router.get(
  `/article/deletecate/:id`,
  expressJoi(schema.id),
  handler.delArtCateById
)
//根据id获取文章分类信息
router.get(`/article/cates/:id`, expressJoi(schema.id), handler.getArtCateInfo)
//更新文章分类信息
router.post(
  `/article/updatecate`,
  expressJoi(schema.Id_name_alias),
  handler.updateCateInfo
)
module.exports = router
